package indi.kider.server.applandlord.service.related;

import indi.kider.common.model.apabus.Bus;
import indi.kider.common.model.apabus.Rent;
import indi.kider.common.model.apabus.RentMonthReport;
import indi.kider.common.model.apartment.Houses;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;
import pers.vankid.common.model.base.CommonResponse;
import pers.vankid.common.model.base.CoreException;
import pers.vankid.common.utils.page.PageRequest;
import pers.vankid.common.utils.page.PageResponse;

import java.util.List;

@FeignClient(value = "apabus")
@RestController
@RequestMapping(value = "apartbus")
public interface ApaBusService {

    @GetMapping("/reportlist/{month}/{phone}")
    CommonResponse<List<RentMonthReport>> getReportlist(@PathVariable(value = "month") String month,
                                                        @PathVariable(value = "phone") String phone);

    @GetMapping("/reportnow/{phone}")
    CommonResponse<RentMonthReport> getReportNow(@PathVariable(value = "phone") String phone);

    @PostMapping("/rentHouse")
    CommonResponse<Rent> rentHouse(@RequestBody Rent rent) ;

    @PutMapping("/rentHouse")
    CommonResponse checkOutHouse(@RequestBody Rent rent) ;

    @PostMapping("/list")
    CommonResponse<PageResponse> getPageServiceList(@RequestBody PageRequest<Bus> request);
}
